//
//  SegmentControlCellData.h
//  18Birdies
//
//  Created by poleness on 2017/2/28.
//  Copyright © 2017年 Lc. All rights reserved.
//

#import "LcCellData.h"
#import "UIButton+Lc.h"

@interface SegmentControlItem : NSObject

- (instancetype)initWithTitle:(NSString*)title;
- (instancetype)initWithTitle:(NSString*)title clickable:(BOOL)clickable;

@property(nonatomic, copy, readonly) NSString* title;
@property(nonatomic, assign, readonly) BOOL clickable;

@property(nonatomic, strong) LcFont* normalTitleFont;
@property(nonatomic, strong) LcFont* hightLightTitleFont;
@property(nonatomic, strong) LcFont* disableTitleFont;

@end

@interface SegmentControlCellData : LcCellData

+ (SegmentControlCellData*)cellDataWithSegmentControlItems:
                               (NSArray<SegmentControlItem*>*)segmentControlItems
                                          OnClickedHandler:(OnIndexClickedHandler)clickedHandler;

+ (SegmentControlCellData*)cellDataWithSegmentControlItems:
                               (NSArray<SegmentControlItem*>*)segmentControlItems
                                             selectedIndex:(int)selectedIndex
                                             segmentEnable:(BOOL)segmentEnable
                                          OnClickedHandler:(OnIndexClickedHandler)clickedHandler;

@property(nonatomic, copy, readonly) NSArray<SegmentControlItem*>* segmentControlItems;
@property(nonatomic, assign) int selectedIndex;
/**
 * had better not set segment and item both unable
 */
@property(nonatomic, assign) BOOL segmentEnable;
@property(nonatomic, strong, readonly) OnIndexClickedHandler clickedHandler;

/**
 control height must <= cellHeight
*/
@property(nonatomic, assign) CGFloat controlHeight;

/**
 SegmentControlStyle
*/
@property(nonatomic, strong) UIColor* tintColor;

@end
